﻿Namespace Exceptions
    Public MustInherit Class MetisNameException
        Inherits Exception

        Protected _FieldName As String

        Sub New(ByVal FieldName As String)
            _FieldName = FieldName
        End Sub

    End Class

    Public Class InvalidNameException
        Inherits MetisNameException

        Sub New(ByVal FieldName As String)
            MyBase.New(FieldName)
        End Sub

        Public Overrides ReadOnly Property Message() As String
            Get
                Return String.Format("'{0}' is an invalid fieldname", _FieldName)
            End Get
        End Property
    End Class

    Public Class DublicateNameException
        Inherits MetisNameException

        Sub New(ByVal FieldName As String)
            MyBase.New(FieldName)
        End Sub

        Public Overrides ReadOnly Property Message() As String
            Get
                Return String.Format("'{0}' is already in use", _FieldName)
            End Get
        End Property
    End Class
End Namespace


